<?php

abstract class HTML_Fluent_XHTML_Element_Base_EM extends HTML_Fluent_Element {

    /**
     * The name of this element
     *
     * @return string
     */
    public function getName() {
        return 'em';
    }

    protected $attributes = array(
        'class' => null,
        'dir' => null,
        'id' => null,
        'lang' => null,
        'onclick' => null,
        'ondblclick' => null,
        'onkeydown' => null,
        'onkeypress' => null,
        'onkeyup' => null,
        'onmousedown' => null,
        'onmousemove' => null,
        'onmouseout' => null,
        'onmouseover' => null,
        'onmouseup' => null,
        'style' => null,
        'title' => null,
    );

    /**
     * Add a new element 'a' as a child
     *
     * @return HTML_Fluent_XHTML_Element_A
     */
    public function a() {
        return $this->newChildElement('a', func_get_args());
    }

    /**
     * Add a new element 'abbr' as a child
     *
     * @return HTML_Fluent_XHTML_Element_ABBR
     */
    public function abbr() {
        return $this->newChildElement('abbr', func_get_args());
    }

    /**
     * Add a new element 'acronym' as a child
     *
     * @return HTML_Fluent_XHTML_Element_ACRONYM
     */
    public function acronym() {
        return $this->newChildElement('acronym', func_get_args());
    }

    /**
     * Add a new element 'b' as a child
     *
     * @return HTML_Fluent_XHTML_Element_B
     */
    public function b() {
        return $this->newChildElement('b', func_get_args());
    }

    /**
     * Add a new element 'bdo' as a child
     *
     * @return HTML_Fluent_XHTML_Element_BDO
     */
    public function bdo() {
        return $this->newChildElement('bdo', func_get_args());
    }

    /**
     * Add a new element 'big' as a child
     *
     * @return HTML_Fluent_XHTML_Element_BIG
     */
    public function big() {
        return $this->newChildElement('big', func_get_args());
    }

    /**
     * Add a new element 'br' as a child
     *
     * @return HTML_Fluent_XHTML_Element_BR
     */
    public function br() {
        return $this->newChildElement('br', func_get_args());
    }

    /**
     * Add a new element 'button' as a child
     *
     * @return HTML_Fluent_XHTML_Element_BUTTON
     */
    public function button() {
        return $this->newChildElement('button', func_get_args());
    }

    /**
     * Add a new element 'cite' as a child
     *
     * @return HTML_Fluent_XHTML_Element_CITE
     */
    public function cite() {
        return $this->newChildElement('cite', func_get_args());
    }

    /**
     * Add a new element 'code' as a child
     *
     * @return HTML_Fluent_XHTML_Element_CODE
     */
    public function code() {
        return $this->newChildElement('code', func_get_args());
    }

    /**
     * Add a new element 'del' as a child
     *
     * @return HTML_Fluent_XHTML_Element_DEL
     */
    public function del() {
        return $this->newChildElement('del', func_get_args());
    }

    /**
     * Add a new element 'dfn' as a child
     *
     * @return HTML_Fluent_XHTML_Element_DFN
     */
    public function dfn() {
        return $this->newChildElement('dfn', func_get_args());
    }

    /**
     * Add a new element 'em' as a child
     *
     * @return HTML_Fluent_XHTML_Element_EM
     */
    public function em() {
        return $this->newChildElement('em', func_get_args());
    }

    /**
     * Add a new element 'i' as a child
     *
     * @return HTML_Fluent_XHTML_Element_I
     */
    public function i() {
        return $this->newChildElement('i', func_get_args());
    }

    /**
     * Add a new element 'img' as a child
     *
     * @return HTML_Fluent_XHTML_Element_IMG
     */
    public function img() {
        return $this->newChildElement('img', func_get_args());
    }

    /**
     * Add a new element 'input' as a child
     *
     * @return HTML_Fluent_XHTML_Element_INPUT
     */
    public function input() {
        return $this->newChildElement('input', func_get_args());
    }

    /**
     * Add a new element 'ins' as a child
     *
     * @return HTML_Fluent_XHTML_Element_INS
     */
    public function ins() {
        return $this->newChildElement('ins', func_get_args());
    }

    /**
     * Add a new element 'kbd' as a child
     *
     * @return HTML_Fluent_XHTML_Element_KBD
     */
    public function kbd() {
        return $this->newChildElement('kbd', func_get_args());
    }

    /**
     * Add a new element 'label' as a child
     *
     * @return HTML_Fluent_XHTML_Element_LABEL
     */
    public function label() {
        return $this->newChildElement('label', func_get_args());
    }

    /**
     * Add a new element 'map' as a child
     *
     * @return HTML_Fluent_XHTML_Element_MAP
     */
    public function map() {
        return $this->newChildElement('map', func_get_args());
    }

    /**
     * Add a new element 'object' as a child
     *
     * @return HTML_Fluent_XHTML_Element_OBJECT
     */
    public function object() {
        return $this->newChildElement('object', func_get_args());
    }

    /**
     * Add a new element 'q' as a child
     *
     * @return HTML_Fluent_XHTML_Element_Q
     */
    public function q() {
        return $this->newChildElement('q', func_get_args());
    }

    /**
     * Add a new element 'samp' as a child
     *
     * @return HTML_Fluent_XHTML_Element_SAMP
     */
    public function samp() {
        return $this->newChildElement('samp', func_get_args());
    }

    /**
     * Add a new element 'script' as a child
     *
     * @return HTML_Fluent_XHTML_Element_SCRIPT
     */
    public function script() {
        return $this->newChildElement('script', func_get_args());
    }

    /**
     * Add a new element 'select' as a child
     *
     * @return HTML_Fluent_XHTML_Element_SELECT
     */
    public function select() {
        return $this->newChildElement('select', func_get_args());
    }

    /**
     * Add a new element 'small' as a child
     *
     * @return HTML_Fluent_XHTML_Element_SMALL
     */
    public function small() {
        return $this->newChildElement('small', func_get_args());
    }

    /**
     * Add a new element 'span' as a child
     *
     * @return HTML_Fluent_XHTML_Element_SPAN
     */
    public function span() {
        return $this->newChildElement('span', func_get_args());
    }

    /**
     * Add a new element 'strong' as a child
     *
     * @return HTML_Fluent_XHTML_Element_STRONG
     */
    public function strong() {
        return $this->newChildElement('strong', func_get_args());
    }

    /**
     * Add a new element 'sub' as a child
     *
     * @return HTML_Fluent_XHTML_Element_SUB
     */
    public function sub() {
        return $this->newChildElement('sub', func_get_args());
    }

    /**
     * Add a new element 'sup' as a child
     *
     * @return HTML_Fluent_XHTML_Element_SUP
     */
    public function sup() {
        return $this->newChildElement('sup', func_get_args());
    }

    /**
     * Add a new element 'textarea' as a child
     *
     * @return HTML_Fluent_XHTML_Element_TEXTAREA
     */
    public function textarea() {
        return $this->newChildElement('textarea', func_get_args());
    }

    /**
     * Add a new element 'tt' as a child
     *
     * @return HTML_Fluent_XHTML_Element_TT
     */
    public function tt() {
        return $this->newChildElement('tt', func_get_args());
    }


    /**
     * Set the value of the 'class' attribute.
     *
     * @param string|null $value
     * @return HTML_Fluent_XHTML_Element_EM
     */
    public function c($value) {
        return $this->setAttribute('class', $value);
    }

    /**
     * Add a class name to the class attribute.
     *
     * @param string $class
     * @return HTML_Fluent_XHTML_Element_EM
     */
    public function addClass($class) {
        $classes = array_unique(preg_split('/\s+/', $this->getAttribute('class'), -1, PREG_SPLIT_NO_EMPTY));
        $classes[] = $class;
        return $this->setAttribute('class', implode(' ', $classes));
    }

    /**
     * Remove a class name from the class attribute.
     *
     * @param string $class
     * @return HTML_Fluent_XHTML_Element_EM
     */
    public function removeClass($class) {
        $classes = array_unique(preg_split('/\s+/', $this->getAttribute('class'), -1, PREG_SPLIT_NO_EMPTY));
        foreach ($classes as $key => $value) {
            if ($value == $class) unset($classes[$key]);
        }
        return $this->setAttribute('class', implode(' ', $classes));
    }

    /**
     * Set the value of the 'dir' attribute.
     *
     * @param string|null $value
     * @return HTML_Fluent_XHTML_Element_EM
     */
    public function dir($value) {
        return $this->setAttribute('dir', $value);
    }

    /**
     * Set the value of the 'id' attribute.
     *
     * @param string|null $value
     * @return HTML_Fluent_XHTML_Element_EM
     */
    public function id($value) {
        return $this->setAttribute('id', $value);
    }

    /**
     * Set the value of the 'lang' attribute.
     *
     * @param string|null $value
     * @return HTML_Fluent_XHTML_Element_EM
     */
    public function lang($value) {
        return $this->setAttribute('lang', $value);
    }

    /**
     * Set the value of the 'onclick' attribute.
     *
     * @param string|null $value
     * @return HTML_Fluent_XHTML_Element_EM
     */
    public function onclick($value) {
        return $this->setAttribute('onclick', $value);
    }

    /**
     * Set the value of the 'ondblclick' attribute.
     *
     * @param string|null $value
     * @return HTML_Fluent_XHTML_Element_EM
     */
    public function ondblclick($value) {
        return $this->setAttribute('ondblclick', $value);
    }

    /**
     * Set the value of the 'onkeydown' attribute.
     *
     * @param string|null $value
     * @return HTML_Fluent_XHTML_Element_EM
     */
    public function onkeydown($value) {
        return $this->setAttribute('onkeydown', $value);
    }

    /**
     * Set the value of the 'onkeypress' attribute.
     *
     * @param string|null $value
     * @return HTML_Fluent_XHTML_Element_EM
     */
    public function onkeypress($value) {
        return $this->setAttribute('onkeypress', $value);
    }

    /**
     * Set the value of the 'onkeyup' attribute.
     *
     * @param string|null $value
     * @return HTML_Fluent_XHTML_Element_EM
     */
    public function onkeyup($value) {
        return $this->setAttribute('onkeyup', $value);
    }

    /**
     * Set the value of the 'onmousedown' attribute.
     *
     * @param string|null $value
     * @return HTML_Fluent_XHTML_Element_EM
     */
    public function onmousedown($value) {
        return $this->setAttribute('onmousedown', $value);
    }

    /**
     * Set the value of the 'onmousemove' attribute.
     *
     * @param string|null $value
     * @return HTML_Fluent_XHTML_Element_EM
     */
    public function onmousemove($value) {
        return $this->setAttribute('onmousemove', $value);
    }

    /**
     * Set the value of the 'onmouseout' attribute.
     *
     * @param string|null $value
     * @return HTML_Fluent_XHTML_Element_EM
     */
    public function onmouseout($value) {
        return $this->setAttribute('onmouseout', $value);
    }

    /**
     * Set the value of the 'onmouseover' attribute.
     *
     * @param string|null $value
     * @return HTML_Fluent_XHTML_Element_EM
     */
    public function onmouseover($value) {
        return $this->setAttribute('onmouseover', $value);
    }

    /**
     * Set the value of the 'onmouseup' attribute.
     *
     * @param string|null $value
     * @return HTML_Fluent_XHTML_Element_EM
     */
    public function onmouseup($value) {
        return $this->setAttribute('onmouseup', $value);
    }

    /**
     * Set the value of the 'style' attribute.
     *
     * @param string|null $value
     * @return HTML_Fluent_XHTML_Element_EM
     */
    public function style($value) {
        return $this->setAttribute('style', $value);
    }

    /**
     * Set the value of the 'title' attribute.
     *
     * @param string|null $value
     * @return HTML_Fluent_XHTML_Element_EM
     */
    public function title($value) {
        return $this->setAttribute('title', $value);
    }

    /**
     * Add a child text node
     *
     * @param string $string
     * @return HTML_Fluent_XHTML_Element_EM
     */
    public function text($string) {
        $this->childNodes[] = new HTML_Fluent_Text($string);
        return $this;
    }

}
